﻿using System;

namespace DTcms.Web.Mvc.UI
{
    /// <summary>
    /// APP接口统一标准模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ModelResponse<T>
    {
        public ModelResponse()
        {
            code = 0;
            msg = "";
        }
        /// <summary>
        /// 0为成功 1是为失败
        /// </summary>
        public int code { get; set; }

        /// <summary>
        /// 总记录数
        /// </summary>
        public long count { get; set; }

        /// <summary>
        /// 错误提示
        /// </summary>
        public string msg { get; set; }

        /// <summary>
        /// 实体对象
        /// </summary>
        public T data { get; set; }
    }

    /// <summary>
    /// APP接口统一标准模型，分页
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ModelResponsePage<T> : ModelResponse<T>
    {
        public int Total { get; set; }
    }
    public class ModelRequest<T>
    {
        public T body { get; set; }
    }
}